package com.iotechn.unimall.app.api.integralactivity;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.IntegralDetailDO;
import com.iotechn.unimall.data.dto.integralactivity.IntegralDetailListDTO;

import java.util.List;
import java.util.Map;

/**
 * 签到接口
 */
@HttpOpenApi(group = "integralDetail", description = "积分详情接口")
public interface IntegralDetailService {

    /**
     * 获取积分情况信息
     * @param type  1代表赚取 2代表消耗
     * @param userId
     * @return
     * @throws ServiceException
     */
    @HttpMethod(description = "积分列表")
    public List<IntegralDetailDO> detailList(
            @HttpParam(name = "type", type = HttpParamType.COMMON, description = "类型") Integer type,
            @HttpParam(name = "userId", type = HttpParamType.USER_NO_ID, description = "用户Id") Long userId
    ) throws ServiceException;

    /**
     * 获取积分情况信息
     * @param type  6代表商品 7代表优惠券
     * @param userId
     * @return
     * @throws ServiceException
     */
    @HttpMethod(description = "兑换记录列表")
    public List<IntegralDetailDO> chargeList(
            @HttpParam(name = "type", type = HttpParamType.COMMON, description = "类型") Integer type,
            @HttpParam(name = "userId", type = HttpParamType.USER_NO_ID, description = "用户Id") Long userId
    ) throws ServiceException;

    /**
     * 获取积分情况信息
     * @param userId
     * @return
     * @throws ServiceException
     */
    @HttpMethod(description = "分享送积分")
    public Boolean shareIntegral(
            @HttpParam(name = "userId", type = HttpParamType.USER_NO_ID, description = "用户Id") Long userId
    ) throws ServiceException;


    @HttpMethod(description = "获取用户积分明细")
    public Map<String,Object> userIntegralDetails(
            @HttpParam(name = "userId", type = HttpParamType.USER_NO_ID, description = "用户Id") Long userId
    )  throws ServiceException;

    @HttpMethod(description = "获取兑换记录")
    public List<IntegralDetailListDTO> getExchangeRecord(
            @HttpParam(name = "userId", type = HttpParamType.USER_NO_ID, description = "用户Id") Long userId
    )  throws ServiceException;


}
